package com.ccx.coachsite.ui.own;

import java.util.Collections;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class OwerAdapterBase<T> extends BaseAdapter{
	protected Context mContext;
	protected final LayoutInflater mInflater;
	protected List<T> mList;
	
	public OwerAdapterBase(Context context, List<T> list) {
		mContext = context;
		mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		
		if(list == null) {
			mList = Collections.emptyList();
		}
		else
		{
			mList = list;
		}
	}
	
	@Override
	public final int getCount() {
		return mList.size();
	}

	@Override
	public final Object getItem(int position) {
		return mList.get(position);
	}

	@Override
	public final long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		return convertView;
	}
}